#!/bin/bash
# 获取昨天日期
yesterday=`date -d yesterday +%Y%m%d`
# 拼写昨天数据所在的路径
datapath="/user_clicks/${yesterday}/clicklog.dat"
echo $datapath
sql="load data inpath '${datapath}' into table default.myuser_clicks partition(dt=${yesterday})"
hive -e "${sql}"
